package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * TbCorpPhoneId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class TbCorpPhoneId implements java.io.Serializable {

	// Fields

	private Integer corpId;
	private String phone;

	// Constructors

	/** default constructor */
	public TbCorpPhoneId() {
	}

	/** minimal constructor */
	public TbCorpPhoneId(Integer corpId) {
		this.corpId = corpId;
	}

	/** full constructor */
	public TbCorpPhoneId(Integer corpId, String phone) {
		this.corpId = corpId;
		this.phone = phone;
	}

	// Property accessors

	@Column(name = "corp_id", nullable = false)
	public Integer getCorpId() {
		return this.corpId;
	}

	public void setCorpId(Integer corpId) {
		this.corpId = corpId;
	}

	@Column(name = "phone", length = 11)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TbCorpPhoneId))
			return false;
		TbCorpPhoneId castOther = (TbCorpPhoneId) other;

		return ((this.getCorpId() == castOther.getCorpId()) || (this
				.getCorpId() != null && castOther.getCorpId() != null && this
				.getCorpId().equals(castOther.getCorpId())))
				&& ((this.getPhone() == castOther.getPhone()) || (this
						.getPhone() != null && castOther.getPhone() != null && this
						.getPhone().equals(castOther.getPhone())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCorpId() == null ? 0 : this.getCorpId().hashCode());
		result = 37 * result
				+ (getPhone() == null ? 0 : this.getPhone().hashCode());
		return result;
	}

}